@use 'mixins' as *;

body {
  font-family: var(--site-body-fontFamily);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  background-color: var(--site-base-bgColor);
  color: var(--site-base-fgColor);

  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*:focus-visible {
  outline: 2px solid var(--site-primary-color);
}

section {
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--site-ui-fontFamily);
  font-weight: 400;
  line-height: 1.2;
  color: var(--site-base-fgColor);
}

h1, .h1 {
  font-family: var(--site-ui-fontFamily);
  font-size: 3rem;
  margin-top: 0;
  margin-bottom: 0;
}

.material-symbols {
  font-family: var(--site-icon-fontFamily);
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

h2, .h2 {
  font-size: 1.5rem;
}

h3, .h3 {
  font-size: 1.3125rem;
}

h4, .h4 {
  font-size: 1.125rem;
}

h5, .h5 {
  font-size: 0.9375rem;
}

h6, .h6 {
  font-size: 0.9375rem;
}

dd {
  margin-left: 1rem;
}

dt {
  a {
    font-weight: 500;
  }
}

a {
  border-radius: 0.2rem;

  &, &:hover, &:visited {
    color: var(--site-link-fgColor);
  }

  &:hover {
    text-decoration: underline;
  }

  &:active {
    color: var(--site-link-fgColor-active);
  }
}

ul {
  padding-inline-start: 2rem;
}

img {
  max-width: 100%;
  height: auto;

  &.diagram-wrap {
    background-color: var(--site-diagram-wrap-bgColor);
    padding: 1rem;
    border-radius: 1rem;
  }
}

dd {
  margin-bottom: 0.75rem;
  margin-top: 0.25rem;
}

blockquote {
  background-color: var(--site-inset-bgColor-translucent);
  padding: 0.75rem 1rem;
  border-left: solid 5px var(--site-inset-borderColor);
  margin: 0;
  margin-block-end: 1rem;

  > p, > li, > ul, > ol {
    &:first-child {
      margin-top: 0;
    }

    &:last-child {
      margin-bottom: 0;
    }
  }
}

details {
  margin-block-start: 1rem;
  margin-block-end: 1rem;

  > summary {
    font-weight: 500;
    user-select: none;
    cursor: pointer;

    &:hover {
      color: var(--site-link-fgColor);
    }

    &:active {
      color: var(--site-link-fgColor-active);
    }
  }

  &[open] {
    margin-bottom: unset;

    > summary {
      margin-bottom: 0.75rem;
    }
  }

  > :not(:first-child) {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }
}

figure {
  figcaption {
    text-align: center;
  }
}
